//
//  MainViewController.m
//  Tongcheng
//
//  Created by 邢广范 on 2017/4/3.
//  Copyright © 2017年 Tongcheng. All rights reserved.
//首页

#import "MainViewController.h"
#import "CCPScrollView.h"
#import "MainTableViewCell.h"
#import "TwoTableViewCell.h"
#import "DLFixedTabbarView.h"
#import "OneViewController.h"
#import "TwoViewController.h"
#import "ThreeViewController.h"

@interface MainViewController ()

@property (strong, nonatomic) UIScrollView *backscrollview;

@end

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tabedSlideView.baseViewController = self;
    self.tabedSlideView.flag = @"2";
    self.tabedSlideView.tabItemNormalColor = [UIColor whiteColor];
    self.tabedSlideView.tabItemSelectedColor = RGB(0xF95880);
    self.tabedSlideView.delegate = self;
    self.tabedSlideView.tabNormalBackcolor = RGB(0xF95880);
    self.tabedSlideView.tabSelectBackcolor = [UIColor whiteColor];
    self.tabedSlideView.tabbarTrackColor = [UIColor clearColor];
    self.tabedSlideView.tabbarBackgroundImage = [UIImage imageNamed:@"tabbarBk"];
    self.tabedSlideView.tabbarBottomSpacing = 3.0;
    
    DLTabedbarItem *item1 = [DLTabedbarItem itemWithTitle:@"推荐" image:[UIImage imageNamed:@""] selectedImage:[UIImage imageNamed:@""] normalColor:[UIColor blackColor] selectColor:[UIColor whiteColor]];
    DLTabedbarItem *item2 = [DLTabedbarItem itemWithTitle:@"附近" image:[UIImage imageNamed:@""] selectedImage:[UIImage imageNamed:@""] normalColor:[UIColor blackColor] selectColor:[UIColor whiteColor]];
    DLTabedbarItem *item3 = [DLTabedbarItem itemWithTitle:@"风云榜" image:[UIImage imageNamed:@""] selectedImage:[UIImage imageNamed:@""]normalColor:[UIColor blackColor] selectColor:[UIColor whiteColor]];
    
    self.tabedSlideView.tabbarItems = @[item1, item2, item3];
    [self.tabedSlideView buildTabbar];
    self.tabedSlideView.selectedIndex = 0;
    
}

- (NSInteger)numberOfTabsInDLTabedSlideView:(DLTabedSlideView *)sender{
    return 3;
}
- (UIViewController *)DLTabedSlideView:(DLTabedSlideView *)sender controllerAt:(NSInteger)index{
    switch (index) {
        case 0:
        {
            OneViewController *ctrl = [[OneViewController alloc] init];
            return ctrl;
        }
        case 1:
        {
            TwoViewController *ctrl = [[TwoViewController alloc] init];
            return ctrl;
        }
        case 2:
        {
            ThreeViewController *ctrl = [[ThreeViewController alloc] init];
            return ctrl;
        }
            
        default:
            return nil;
    }
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [self.navigationController setNavigationBarHidden:NO];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
